package com.example.spring_mysql.configuration

import org.springframework.boot.actuate.endpoint.annotation.Endpoint
import org.springframework.boot.actuate.endpoint.annotation.ReadOperation
import org.springframework.stereotype.Component


@Component
@Endpoint(id = "hello") // Actuator 端点路径：/actuator/hello
class HelloEndpoint {
    @ReadOperation
    fun sayHello(): Map<String, String> {
        val result: MutableMap<String, String> = HashMap()
        result["message"] = "Hello, Actuator!"
        result["status"] = "ok"
        return result
    }
}
